# -*- coding: utf-8 -*-
import logging

def _kr(str):
    return unicode(str).encode('euc-kr')

def _kr_u_(str):
    return unicode(str, 'utf-8').encode('euc-kr')

def e_u(str):
    return

def location_(t):
    if t == 'A':
        return u'호주'
    else:
        return u'한국'

def kr_money_(money):
    if not isinstance(money, str):
        money = str(money)
    d = {
         '1': u'일',
         '2': u'이',
         '3': u'삼',
         '4': u'사',
         '5': u'오',
         '6': u'육',
         '7': u'칠',
         '8': u'팔',
         '9': u'구',
         }
    u = (u'', u'십', u'백', u'천')
    uu = (u'원', u'만', u'억', u'조')
    s, k = '', 0
    for i, n in enumerate(money[::-1]):
        j = i % 4
        if j == 0:
            s = uu[k] + s
            k = k + 1
        if n != '0':
            s = d[n] + u[j]  + s
    return ''.join(s)

